﻿using System;
using System.Collections.Generic;
using CRM.Core.DataInterfaces;
using CRM.Core.Entities;
using CRM.Data;
using CRM.Presenter;
using CRM.Presenter.Interfaces;
using CRM.Web.Common;
using StructureMap;

namespace CRM.Web
{
    public partial class _Default : System.Web.UI.Page,ICustomer
    {
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);
            DelegateEvents();
        }

        protected void Page_Load(object sender, EventArgs e)
        {
        }

        private void DelegateEvents()
        {
            btnSearch.Click += new CustomerPresenter(this).CustomerSearch;
            btnThrowError.Click += new ElmahErrorLogCheck().LogDivideByZeroError;
        }

        public IList<CustomerEntity> BindCustomerData
        {
            set{gdCustomer.BindToGrid(value);}
        }
    }
}
